package com.wzdigit.wms.wms.service.core.putaway;

import com.wzdigit.wms.basic.domain.order.PutawayTask;
import com.wzdigit.wms.basic.mapper.core.order.PutawayTaskMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 上架任务 服务类
 * </p>
 *
 * @author
 * @since 2021-01-19
 */

@Service
@Slf4j
public class PutawayTaskService {

    @Autowired
    PutawayTaskMapper putawayTaskMapper;

    /**
     * 根据入参实体添加
     *
     * @param putawayTask
     * @return
     */
    public PutawayTask addNewOne(PutawayTask putawayTask) {
        int row = putawayTaskMapper.insert(putawayTask);
        log.info("成功新增{}条记录", row);

        return putawayTask;
    }

    /**
     * 根据入参实体更新一条记录
     *
     * @param putawayTask
     * @return
     */
    public PutawayTask updateOne(PutawayTask putawayTask) {
        int row = putawayTaskMapper.updateById(putawayTask);
        log.info("成功更新{}条记录", row);

        return putawayTask;
    }
}
